package com.cskaoyan.controller;

import com.cskaoyan.bean.BaseRespVo;
import com.cskaoyan.bean.goodsbean.wxvo.TopicBean;
import com.cskaoyan.bean.goodsbean.wxvo.WxRelatedTopicVO;
import com.cskaoyan.bean.goodsbean.wxvo.WxTopicDetailVO;
import com.cskaoyan.bean.goodsbean.wxvo.WxTopicListVO;
import com.cskaoyan.service.WxTopicService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @program: whyccz-mall-project
 * @description:
 * @create: 2021-06-08 19:55
 **/
@RestController
@RequestMapping("wx/topic")
public class WxTopicController {
	@Autowired
	WxTopicService wxTopicService;

	///wx/topic/list?page=1&size=10
	@RequestMapping("list")
	public BaseRespVo getTopicList(Integer page,Integer size){
		WxTopicListVO topicListVO=wxTopicService.getTopicList(page,size);
		return BaseRespVo.ok();
	}

	@RequestMapping("detail")
	public BaseRespVo getTopicDetail(Integer id){
		WxTopicDetailVO wxTopicDetailVO=wxTopicService.getTopicDetail(id);
		return BaseRespVo.ok(wxTopicDetailVO);
	}

	@RequestMapping("related")
	public BaseRespVo getTopicRelated(Integer id){
		List<TopicBean> wxRelatedTopicVO=wxTopicService.getRelatedTopic(id);
		return BaseRespVo.ok(wxRelatedTopicVO);
	}


}
